{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ca73ba3e-2210-4990-a2d1-bc4b6738d970",
   "metadata": {},
   "source": [
    "# 1、任务描述"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "51bbb58e-d8a2-436c-ba5b-d1be8db42bd7",
   "metadata": {},
   "source": [
    "- 将模型输出的概率值根据值区间分割为4个等级，分别为：极低风险、低风险、中风险、高风险\n",
    "- 并统计每个风险等级所占的比例"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "09ccfe9e-20e3-4f55-b9a1-654e633f7c74",
   "metadata": {
    "jp-MarkdownHeadingCollapsed": true,
    "tags": []
   },
   "source": [
    "## 1.1、模型输出结果形式\n",
    "\n",
    "模型（随机森林、LSTM）的结果输出为csv文件，csv文件有三列：\n",
    "\n",
    "- \\# GeoID ： 该列是栅格单元或者斜坡单元位置的标记，**不要修改和改动**\n",
    "\n",
    "- y_pred_class：预测结果的类别，数值为1表示预测类别为滑坡，数值为0时表示预测类别为非滑坡。\n",
    "\n",
    "- y_pred_prob：预测结果的概率。当概率大于0.5时，y_pred_class=1，预测为滑坡；概率小于0.5时，y_pred_class=0，预测为非滑坡\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d7f24343-975c-4f34-aa7f-4e24b33840c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src=\"./doc_pics/01.结果形式.png\" width=200 height=100></img>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src=\"./doc_pics/01.结果形式.png\" width=200 height=100></img>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "681d9a25-4e9f-46e2-9ba2-d4bd0f13b007",
   "metadata": {},
   "source": [
    "## 1.2、重分类任务\n",
    "\n",
    "**y_pred_prob** 的取值范围为[0, 1]， 如果最终的滑坡敏感性分为4个等级，分别为：极低风险、低风险、中风险、高风险。\n",
    "\n",
    "- 如果采用**等距离分割**的方式，那么\n",
    "\n",
    "    [0.0, 0.25] 被映射为--》极低风险\n",
    "    \n",
    "    [0.25, 0.5] 被映射为--》低风险\n",
    "    \n",
    "    [0.5, 0.75] 被映射为--》中风险\n",
    "    \n",
    "    [0.75, 1.0] 被映射为--》高风险\n",
    "    \n",
    "    \n",
    "**因此**：需要将**y_pred_prob** 的值作修改。\n",
    "\n",
    "- 如果取值范围在[0.0, 0.25] ，则**y_pred_prob**值映射为：1\n",
    "    \n",
    "- 如果取值范围在[0.25, 0.5]  ，则**y_pred_prob**值映射为：10\n",
    "    \n",
    "- 如果取值范围在[0.5, 0.75] ，则**y_pred_prob**值映射为：100\n",
    "    \n",
    "- 如果取值范围在[0.75, 1.0]  ，则**y_pred_prob**值映射为：1000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "4b3e4a85-b63c-46aa-a784-9fdf0b9c3248",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6e453af4-5c24-40e1-9e4e-c69f7deb3fc3",
   "metadata": {},
   "source": [
    "# 2、重分类"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7ca8d87f-e9c1-4b73-9058-78ed4ca07030",
   "metadata": {},
   "source": [
    "## 2.1、读取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "20d4fe6e-16dd-4e45-b4ed-e53c10d55edf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th># GeoID</th>\n",
       "      <th>y_pred_class</th>\n",
       "      <th>y_pred_prob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0.004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0.004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0.004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0.004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>0.004</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   # GeoID   y_pred_class   y_pred_prob\n",
       "0        2              0         0.004\n",
       "1        3              0         0.004\n",
       "2        4              0         0.004\n",
       "3        5              0         0.004\n",
       "4        6              0         0.004"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"results_lr.csv\",header=0,encoding=\"utf-8\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a213cf8f-0904-4336-a5e0-be81beb02521",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th># GeoID</th>\n",
       "      <th>y_pred_class</th>\n",
       "      <th>y_pred_prob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>636185</th>\n",
       "      <td>644585</td>\n",
       "      <td>0</td>\n",
       "      <td>0.003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>636186</th>\n",
       "      <td>644586</td>\n",
       "      <td>0</td>\n",
       "      <td>0.003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>636187</th>\n",
       "      <td>644590</td>\n",
       "      <td>0</td>\n",
       "      <td>0.003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>636188</th>\n",
       "      <td>644591</td>\n",
       "      <td>0</td>\n",
       "      <td>0.003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>636189</th>\n",
       "      <td>644592</td>\n",
       "      <td>0</td>\n",
       "      <td>0.003</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        # GeoID   y_pred_class   y_pred_prob\n",
       "636185   644585              0         0.003\n",
       "636186   644586              0         0.003\n",
       "636187   644590              0         0.003\n",
       "636188   644591              0         0.003\n",
       "636189   644592              0         0.003"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb3e9629-ef68-4b70-a8d0-0eb9e5bb7ff4",
   "metadata": {},
   "source": [
    "## 2.2、重分类映射函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a9dc3552-00d9-4d5a-9d6b-240f7a8857af",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 映射函数，将概率分为四个等级：极低风险、低风险、中风险、高风险\n",
    "def fun(prob):\n",
    "    re = 1\n",
    "    if prob>0.75:\n",
    "        re = 1000\n",
    "    elif prob>0.5 and prob<=0.75:\n",
    "        re = 100\n",
    "    elif prob>0.25 and prob<=0.5:\n",
    "        re = 10\n",
    "    elif prob>0.0 and prob<=0.25:\n",
    "        re= 1\n",
    "    return re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "afd227b3-6b4a-45a7-89a3-98685ef734db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['# GeoID', ' y_pred_class', ' y_pred_prob'], dtype='object')"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "509843b4-ed7a-4957-be55-ed2b3a215b3b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th># GeoID</th>\n",
       "      <th>y_pred_class</th>\n",
       "      <th>y_pred_prob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>49044</th>\n",
       "      <td>50543</td>\n",
       "      <td>1</td>\n",
       "      <td>0.514</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49298</th>\n",
       "      <td>50797</td>\n",
       "      <td>1</td>\n",
       "      <td>0.523</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49299</th>\n",
       "      <td>50798</td>\n",
       "      <td>1</td>\n",
       "      <td>0.540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49300</th>\n",
       "      <td>50799</td>\n",
       "      <td>1</td>\n",
       "      <td>0.553</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49555</th>\n",
       "      <td>51054</td>\n",
       "      <td>1</td>\n",
       "      <td>0.511</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49556</th>\n",
       "      <td>51055</td>\n",
       "      <td>1</td>\n",
       "      <td>0.527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49557</th>\n",
       "      <td>51056</td>\n",
       "      <td>1</td>\n",
       "      <td>0.536</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49813</th>\n",
       "      <td>51313</td>\n",
       "      <td>1</td>\n",
       "      <td>0.512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49814</th>\n",
       "      <td>51314</td>\n",
       "      <td>1</td>\n",
       "      <td>0.511</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50066</th>\n",
       "      <td>51568</td>\n",
       "      <td>1</td>\n",
       "      <td>0.555</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50067</th>\n",
       "      <td>51569</td>\n",
       "      <td>1</td>\n",
       "      <td>0.536</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50324</th>\n",
       "      <td>51828</td>\n",
       "      <td>1</td>\n",
       "      <td>0.519</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>456615</th>\n",
       "      <td>462898</td>\n",
       "      <td>1</td>\n",
       "      <td>0.512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>456885</th>\n",
       "      <td>463169</td>\n",
       "      <td>1</td>\n",
       "      <td>0.515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>456886</th>\n",
       "      <td>463170</td>\n",
       "      <td>1</td>\n",
       "      <td>0.503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>457172</th>\n",
       "      <td>463466</td>\n",
       "      <td>1</td>\n",
       "      <td>0.507</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>458680</th>\n",
       "      <td>464979</td>\n",
       "      <td>1</td>\n",
       "      <td>0.517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>458976</th>\n",
       "      <td>465279</td>\n",
       "      <td>1</td>\n",
       "      <td>0.503</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        # GeoID   y_pred_class   y_pred_prob\n",
       "49044     50543              1         0.514\n",
       "49298     50797              1         0.523\n",
       "49299     50798              1         0.540\n",
       "49300     50799              1         0.553\n",
       "49555     51054              1         0.511\n",
       "49556     51055              1         0.527\n",
       "49557     51056              1         0.536\n",
       "49813     51313              1         0.512\n",
       "49814     51314              1         0.511\n",
       "50066     51568              1         0.555\n",
       "50067     51569              1         0.536\n",
       "50324     51828              1         0.519\n",
       "456615   462898              1         0.512\n",
       "456885   463169              1         0.515\n",
       "456886   463170              1         0.503\n",
       "457172   463466              1         0.507\n",
       "458680   464979              1         0.517\n",
       "458976   465279              1         0.503"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[' y_pred_prob']>0.5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ecac64e3-fe3e-4d97-830b-ec9c88f7fc60",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "505032d3-7cbc-4bd5-99b8-8ba8cd2d7136",
   "metadata": {},
   "source": [
    "## 2.3、执行映射"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "44e6c2e8-f095-4776-8d07-2e59476ff4a0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0         1\n",
       "1         1\n",
       "2         1\n",
       "3         1\n",
       "4         1\n",
       "         ..\n",
       "636185    1\n",
       "636186    1\n",
       "636187    1\n",
       "636188    1\n",
       "636189    1\n",
       "Name:  y_pred_prob, Length: 636190, dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 奶奶的，注意y_pred_prob前面有空格，小心这个坑。最好保存csv文件时去除这个空格\n",
    "reclass_df = df[' y_pred_prob'].apply(lambda x: fun(x))\n",
    "reclass_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "11523d5f-04f9-48fc-a3ae-c9cdb1758737",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.514\n",
      "\n",
      "100\n"
     ]
    }
   ],
   "source": [
    "print(df[' y_pred_prob'][49044])\n",
    "print()\n",
    "print(reclass_df[49044]) # 49044索引位置的值为0.514,因此被映射为100"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a70bbc39-40fe-4435-8e2e-2293f5277abf",
   "metadata": {},
   "source": [
    "# 3、统计每个类别的占比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "dbd615fd-a422-4f40-b097-f33c3e3f3e89",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 3.1、占比统计，映射函数\n",
    "def calc_percentage(val_counts, total_counts):\n",
    "    return val_counts*1.0/total_counts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "a31f6164-82ee-4d3b-811d-12a79ef10587",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1      0.987483\n",
       "10     0.012488\n",
       "100    0.000028\n",
       "Name:  y_pred_prob, dtype: float64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_cnt = reclass_df.size\n",
    "reclass_df.value_counts().apply(lambda x: calc_percentage(x, total_cnt))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1e333d44-be7f-44ba-a1bc-c7e34e0aaed3",
   "metadata": {},
   "source": [
    "# 4、同时执行：（1）重分类；（2）统计分类占比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "e8d99374-7696-454d-9161-b6eca869e81c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def reclass_statistics(csv_filename, encoding='utf-8', prob_columname=' y_pred_prob'):\n",
    "    df = pd.read_csv(csv_filename, header=0, encoding=encoding)\n",
    "    # 执行重分类映射\n",
    "    reclass_df = df[prob_columname].apply(lambda x: fun(x))\n",
    "    # 统计重分类后每个类别所占的比例\n",
    "    total_cnt = reclass_df.size\n",
    "    statistics_df = reclass_df.value_counts().apply(lambda x: calc_percentage(x, total_cnt))\n",
    "    return reclass_df, statistics_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "2a6fdb2b-0f6d-4c35-9c27-eca7a72dc1cf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1      628227\n",
      "10       7945\n",
      "100        18\n",
      "Name:  y_pred_prob, dtype: int64\n",
      "\n",
      "1      0.987483\n",
      "10     0.012488\n",
      "100    0.000028\n",
      "Name:  y_pred_prob, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "reclass_df, statistics_df = reclass_statistics(\"results_lr.csv\", encoding='utf-8', prob_columname=' y_pred_prob')\n",
    "print(reclass_df.value_counts())\n",
    "print()\n",
    "print(statistics_df)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "85f98bce-ab3a-4de4-9ec8-d8709eec4ff2",
   "metadata": {},
   "source": [
    "# 5、批量执行：（1）重分类；（2）统计分类占比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "46b73812-cb00-4256-9dbc-4ca4d78bf076",
   "metadata": {},
   "outputs": [],
   "source": [
    "csv_filename_list = [\n",
    "    'results_dnn.csv',\n",
    "    'results_lr.csv',\n",
    "    'results_lstm.csv',\n",
    "    'results_rf.csv',\n",
    "    'results_wdnn.csv',\n",
    "    'results_wlr.csv',\n",
    "    'results_wlstm.csv',\n",
    "    'results_wrf.csv'\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "e9794d4e-0d3a-44da-9ef3-07ff61155677",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "------------------------------\n",
      "results_dnn.csv\n",
      "\n",
      "1       0.932941\n",
      "10      0.012531\n",
      "100     0.010525\n",
      "1000    0.044003\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_lr.csv\n",
      "\n",
      "1      0.987483\n",
      "10     0.012488\n",
      "100    0.000028\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_lstm.csv\n",
      "\n",
      "1       0.941502\n",
      "10      0.006309\n",
      "100     0.006833\n",
      "1000    0.045356\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_rf.csv\n",
      "\n",
      "1       0.946120\n",
      "10      0.003884\n",
      "100     0.006838\n",
      "1000    0.043158\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_wdnn.csv\n",
      "\n",
      "1       0.920131\n",
      "10      0.012433\n",
      "100     0.010054\n",
      "1000    0.057382\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_wlr.csv\n",
      "\n",
      "1       0.747072\n",
      "10      0.178593\n",
      "100     0.067639\n",
      "1000    0.006696\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_wlstm.csv\n",
      "\n",
      "1       0.935430\n",
      "10      0.002933\n",
      "100     0.003265\n",
      "1000    0.058372\n",
      "Name:  y_pred_prob, dtype: float64\n",
      "------------------------------\n",
      "results_wrf.csv\n",
      "\n",
      "1       0.815700\n",
      "10      0.071914\n",
      "100     0.046838\n",
      "1000    0.065548\n",
      "Name:  y_pred_prob, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "for csv_filename in csv_filename_list:\n",
    "    print('-'*30)\n",
    "    print(csv_filename)\n",
    "    reclass_df, statistics_ss = reclass_statistics(csv_filename, encoding='utf-8', prob_columname=' y_pred_prob')\n",
    "    # print(reclass_df.value_counts())\n",
    "    print()\n",
    "    print(statistics_ss.sort_index())\n",
    "    # print(statistics_ss.index)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a9d68d39-66a5-4e87-9d36-7983036186f0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.19"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
